# -*- coding: utf-8 -*-
"""
@Time ： 2023/4/4 20:56
@Auth ： Mr. William 1052949192
@Company ：特斯汀学院 @testingedu.com.cn
@Function ：12036验证码
"""
from selenium.webdriver import ActionChains

from class08.homework import MyWeb

web = MyWeb()
web.open_browser('ed')
driver = web.driver
# 第一步：显示验证码
driver.get('https://kyfw.12306.cn/otn/resources/login.html')
driver.find_element('xpath', '//*[@id="J-userName"]').send_keys('i_wanting@yeah.net')
driver.find_element('xpath', '//*[@id="J-password"]').send_keys('xiaobao168')
driver.find_element('xpath', '//*[@id="J-login"]').click()
# 第二步
ele = driver.find_element('xpath', '//*[@id="nc_1_n1z"]')
# 鼠标操作类
action = ActionChains(driver)
action.move_to_element(ele).click_and_hold().move_by_offset(500, 0).perform()

# 第三步
# 作业，自动化买票
